#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#Currently this file is included by two python files here. They are:-
#1. Initiator.py 2. compile_vPath_dissector.py
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#importing system files....
import os
import string

#----------------------------------------------------------------------------
#This method checks that the arguments passed to the python file are
#correct in number. The input_check method takes the "number of
#arguments" and as for running locally or remotely, the same number of
#arguments are required, so its set here to "3". If its not equal to
#"3", then it displays an error. In case of wrong number of arguments
#specified, the returncode is "-999" and if its correct, then a
#returncode of "0" is returned.

#def input_check(no_args):
#    if no_args!=3:  #In our program, we are taking 2 arguments and the
#                    #filename, so its specified "3" here.....
#        print "-------------------------------------------------------------\
#-------------------"
#        print "Wrong number of arguments specified.... please check them....."
#        print "\nThe syntax is \"Python <filename.py> <Directory where code \
#is present> <want to \'make dist clean\'..... [options are \"Yes\" \
#or \"No\"]>\" "
#        print "------------------------------------------------------------\
#--------------------"
#        return -999    #We have assumed a returncode of -999 for
#                       #failure of correct number of arguments......
#    return 0    #If everything goes fine, then a returncode 0 is
#                #returned.......

#----------------------------------------------------------------------------
#This method checks that the argument passed is either "Yes" or
#"No". If its something else than this, then it will return an
#errorcode of "-998" and if its correct, then it will return "0" as
#the errorcode.

#def arg_yes_no_check(argv):
#    if string.upper(argv)=="YES" or string.upper(argv)=="NO":
#        return 0;      #If correct number of arguments are specified,
#                       #then return 0
#    else:
#        return -998;   #If wrong number of arguments are specified,
#                       #then return an errorcode of -998 which
#                       #indicates this error....

#----------------------------------------------------------------------------
#This argument checks whether the path specified by the user exists or
#not. So if it is present, then it will return "True", otherwise
#"False".

def path_check(path):
    if path==None:
        print "No path specified.... Please check and correct it...."
        return False
    return os.path.exists(path)         
#This checks whether the path specified exists or not and then returns
# True or False.

#----------------------------------------------------------------------------
